package cn.itsource.org.domain;

import cn.itsource.basic.Mybasicdomain;
import cn.itsource.org.util.BaseTreeNode;
import lombok.Data;


import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

@Data
@Table(name="t_department")
public class Department extends BaseTreeNode<Department> implements Mybasicdomain {
    /*主键*/
    @Id
    @GeneratedValue(generator = "JDBC")
    private Long id;
    /*部门编号*/
    @NotNull
    @NotBlank(message = "请输入部门编号")
    private String sn;
    /*部门名称*/
    @NotNull
    @NotBlank(message = "请输入部门名称")
    private String name;
    /*暂时不用*/
    private String dirPath;
    /*部门状态 0 正常 ，-1 停用*/
    private Integer state;
    @Transient
    private String parent;
    private Long parentId;
    @Transient
    private String manager;
    private Long managerId;

    private Boolean del;

    @Transient
    private List<Department> children;

    public Department(){

    }
    public Department(Long id, Boolean aFalse) {
        this.id=id;
        this.del=aFalse;
    }


    // 此处省略了getter和setter方法
}